<script>
    // 定义对象
    let user = {
        "username": 'wzd',
        "age": 12
    };

    // 传统写法
    let name1 = user.username;
    let age1 = user.age;
    console.log(name1);
    console.log(age1);

    // es6 写法
    let {
        username,
        age
    } = user //注意：结构的变量必须是user中的属性
    console.log(username, age)
    console.log(user);
</script>